package org.fas.utils
{
	import flash.utils.getTimer;

	public class FuInter
	{
		/**
		 *last click target saved by function: checkDoubleChick 
		 */		
		public static var lastClickTarget:Object;
		/**
		 *last click time saved by function: checkDoubleChick 
		 */	
		public static var lastClickTime:int;
		/**
		 *max delay of double click,can be set outside 
		 */		
		public static var doubleClickMaxDelay:int = 400;
		/**
		 *check a target is been click two  
		 * @param _target
		 * @return 
		 * 
		 */		
		public static function checkDoubleClick(_target:Object):Boolean{
			if(lastClickTarget!= _target|| lastClickTime==0){
				lastClickTarget = _target;
				lastClickTime = flash.utils.getTimer();
				return false;
			}
			var _newTime:int = flash.utils.getTimer();
			var _delay:int = _newTime-lastClickTime;
			if(_delay>0 && _delay<doubleClickMaxDelay){
				return true;
			}else{
				lastClickTime = flash.utils.getTimer();
				return false;
			}
		}
	}
}